<template>
	<div id="tmpl">
		<!--轮播图使用mint-ui的swipe-->
		<mt-swipe :auto="4000">
		  <mt-swipe-item v-for="item in list">
		  	<img :src="item.img" alt="" />
		  </mt-swipe-item>
		  <!--<mt-swipe-item>2</mt-swipe-item>
		  <mt-swipe-item>3</mt-swipe-item>-->
		</mt-swipe>
		<!--导航区使用mui的九宫格组件-->
		<div class="mui-content">
		        <ul class="mui-table-view mui-grid-view mui-grid-9">
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
		            	<router-link to='/news/newslist' >
		                    <span class="mui-icon news"></span>
		                    <div class="mui-media-body">新闻资讯</div>
		            	</router-link >
		            </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
		            	<router-link to='/phone/phonelist' >
		                    <span class="mui-icon imgshare"></span>
		                    <div class="mui-media-body">图片分享</div>
		            	</router-link >
		            </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
		            	<router-link to='/goods/goodslist' >
		                    <span class="mui-icon goods"></span>
		                    <div class="mui-media-body">商品购买</div>
		            	</router-link >
		            </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
		            	<router-link to='/feedback' >
		                    <span class="mui-icon feedback"></span>
		                    <div class="mui-media-body">留言反馈</div>
		            	</router-link >
		            </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
		            	<router-link to='/video' >
		                    <span class="mui-icon video"></span>
		                    <div class="mui-media-body">视频专区</div>
		            	</router-link >
		            </li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
		            	<router-link to='/callme' >
		                    <span class="mui-icon callme"></span>
		                    <div class="mui-media-body">联系我们</div>
		            	</router-link >
		            </li>		          
		        </ul> 
		</div>
	</div>
</template>
<script>
	import {Toast} from 'mint-ui';
	export default({
		data(){
			return {
				list:[],
			}
		},
		created(){
			this.getimgs();
		},
		methods:{
			getimgs(){
				var url='http://webhm.top:8899/api/getlunbo';
				//请求图片数据
				this.$http.get(url)
				.then(function(response){
					var data = response.body;
					//异常处理
					if(data.status!=0){
						Toast(data.message);
						return;
					}
					this.list = data.message;
				})
			}
		},
	})
</script>
<style scoped>
	.mint-swipe{
		height: 300px;
	}
	.mint-swipe-item{
		width: 100%;
		height: 300px;
	}
	.mint-swipe-item img{
		display: block;
		width: 100%;
		height: 300px;
	}
	ul.mui-grid-view.mui-grid-9{
		background-color: #fff;
		margin-top: 0;
	}
	.mui-grid-view.mui-grid-9 .mui-table-view-cell{
		border: none;
	}
	.mui-grid-view.mui-grid-9 .mui-media .mui-icon{
		content:'';
		display: inline-block;
		width: 50px;
		height: 50px;
		background-repeat: round;		
	}
	span.news{
		background:url('../../statics/imgs/1.png');
	}
	
	span.imgshare{
		background:url('../../statics/imgs/2.png');
	}
	span.goods{
		background:url('../../statics/imgs/3.png');
	}
	span.feedback{
		background:url('../../statics/imgs/4.png');
	}
	span.video{
		background:url('../../statics/imgs/5.png');
	}
	span.callme{
		background:url('../../statics/imgs/6.png');
	}
</style>